<?php

use yii\db\Migration;

class m170223_032457_alter_site extends Migration
{
    public function safeUp()
    {
        $this->update("{{%site}}",['mode'=>1],['mode'=>'A']);
        $this->update("{{%site}}",['mode'=>2],['mode'=>'B']);
        $this->alterColumn('{{%site}}','mode','tinyint(2)  default 0 comment \'所属类型（1共同体 2综合体 3管弦乐）\'');
    }

    public function safeDown()
    {
        $this->alterColumn('{{%site}}','mode','varchar(10) default NULL comment \'模式（A/B）\'');
    }
}
